﻿<%@ page import="com.apexedu.identity.security.CasLoginUtil" %>
<%@ page import="com.apexedu.identity.entity.TSysUser" %>
<%@ page import="com.apexedu.identity.IdConstants" %>
<%@ page import="com.apexedu.portal.constant.Constants" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    request.setAttribute("basePath", request.getContextPath());
    TSysUser user = (TSysUser) request.getSession().getAttribute(IdConstants.SESSION_USER);
    String type = (String) request.getSession().getAttribute("type");
    request.setAttribute("userid", user.getUserloginid());
    request.setAttribute("username", user.getUsername());
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="${basePath}/resources/css/mh.shgh.css" rel="stylesheet">
<script type="text/javascript" src="${basePath}/clientui/js/jquery-1.4.js"></script>
<script>
    var type = '<%=type%>';
    function execLogout() {
        if (window.confirm('确定要退出系统吗？')) {
            $.get("${basePath}/identity/ajaxlogin.action?act=logout", {q: (new Date()).getTime()}, function (data) {
                data = eval("(" + data + ")");
                if (data.msg == 'success') {
                    <%
                if( CasLoginUtil.isSsoEnabled() ){
                %>
                    window.location.href = '<%=CasLoginUtil.getCasServerLogoutUrl()%>';
                    <%
                    }else{
                    %>
                    window.location.href = '<%=request.getContextPath() %>?t=' + Math.round(new Date / 1000);
                    <%
                    }
                    %>
                } else {
                    alert(data.msg);
                }
            });
            setTimeout(function () {
                <%
                if( CasLoginUtil.isSsoEnabled() ){
                %>
                window.location.href = '<%=CasLoginUtil.getCasServerLogoutUrl()%>';
                <%
                }else{
                %>
                window.location.href = '<%=request.getContextPath() %>?t=' + Math.round(new Date / 1000);
                <%
                }
                %>
            }, 1000);
        }
    }
</script>
<script type="text/javascript" src="${basePath}/resources/js/mh.shgh.index.js"></script>
<div id="head">
    <div id="headline">
        <span class="headSpan">
            <img src="${basePath}/userinfo/${userid}" onerror="this.src='${basePath}/userinfo/user_male_portrait.png'">
            <img src="${basePath}/resources/images/touxiangmask.png" class="mask">
        </span>
        <span class="usernameSpan">${username}
        <div class="infoMenu">
            <div class="arrow"><img src="${basePath}/resources/images/sanjiao.png"></div>
            <ul>
                <%if ("admin".equals(user.getUserloginid())) {%>
                <li onclick="location.href='/identity/index.action?flag=true'">管理后台
                </li>
                <%if (!Constants.MhUserType.LS.equals(type)) {%>
                <li onclick="location.href='${basePath}/s/uc/shgh/i?type=ls'">教师站点
                </li>
                <%
                    }
                    if (!Constants.MhUserType.LD.equals(type)) {
                %>
                <li onclick="location.href='${basePath}/s/uc/shgh/i?type=ld'">领导站点
                </li>
                <%
                    }
                    if (!Constants.MhUserType.XS.equals(type)) {
                %>
                <li onclick="location.href='${basePath}/s/uc/shgh/i?type=xs'">学生站点
                </li>
                <%
                        }
                    }
                    if (!Constants.MhUserType.XS.equals(type)) {%>
                <li onclick="window.open('${basePath}/email.jsp')">我的邮箱
                </li>
                <%
                    }
                %>
                <li onclick="window.open('${basePath}/s/uc/mh/hp')">头像上传
                </li>
                <li onclick="window.open('${basePath}/s/uc/mh/pf')">密保问题
                </li>
                <li onclick="window.open('${basePath}/s/uc/mh/up')">修改密码
                </li>
            </ul>
        </div>
        </span>
        <span class="editSpan">

        </span>
        <span class="exitSpan" onclick="execLogout()"><img src="${basePath}/resources/images/icon_out.png">注销</span>
    </div>
    <div id="logo"></div>
    <div id="title">
        <%if (Constants.MhUserType.LS.equals(type)) {%>
        <ul class="titleUl">
            <li onclick="location.href='${basePath}/s/uc/shgh/i'" class="titleLi">首页</li>
            <li onclick="location.href='${basePath}/s/uc/shgh/xzgl'" class="titleLi">行政管理</li>
            <li onclick="location.href='${basePath}/s/uc/shgh/jxgl'" class="titleLi">教学管理</li>
            <li onclick="location.href='${basePath}/s/uc/shgh/xsgl'" class="titleLi">学生管理</li>
            <li onclick="window.open('http://jpkc.shghxyedu.net:8106/')" class="titleLi">教学资源</li>
            <li onclick="window.open('http://192.168.173.239:5050/')" class="titleLi">人事管理</li>
            <li onclick="window.open('http://192.168.173.243/')" class="titleLi">科研管理</li>
	    <li onclick="window.open('http://cw.shghxy.com:7410/SFP_Portal/')" class="titleLi">财务系统</li>
            <li onclick="window.open('http://192.168.175.250/ssologin/home.aspx')" class="titleLi">一卡通</li>
        </ul>
        <%} else if (Constants.MhUserType.LD.equals(type)) {%>
        <ul class="titleUl" style="width: 770px;">
            <li onclick="location.href='${basePath}/s/uc/shgh/i'" class="titleLi">首页</li>
            <li onclick="location.href='${basePath}/s/uc/shgh/s/navserver_WAR_nj612portlet_INSTANCE_hVunExHq6PNQ?no=1'" class="titleLi">行政办公</li>
            <li onclick="location.href='${basePath}/s/uc/shgh/s/navserver_WAR_nj612portlet_INSTANCE_MRm2DnwdS8Lm?no=2'" class="titleLi">学生工作</li>
            <li class="titleLi">教学工作</li>
            <li onclick="location.href='${basePath}/s/uc/shgh/s/navserver_WAR_nj612portlet_INSTANCE_Ll6bCiywMUpD?no=4'" class="titleLi">后勤资产</li>
	    <li onclick="window.open('http://192.168.173.4:5050/')" class="titleLi">人事管理</li>
            <li onclick="window.open('http://192.168.173.243/')" class="titleLi">科研管理</li>
            <li onclick="window.open('http://192.168.175.250/ssologin/home.aspx')" class="titleLi">一卡通</li>
        </ul>
        <%} else if (Constants.MhUserType.XS.equals(type)) {%>
        <ul class="titleUl" style="width: 668px;">
            <li onclick="location.href='${basePath}/s/uc/shgh/i'" class="titleLi">首页</li>
            <li onclick="location.href='${basePath}/s/uc/shgh/xssh'" class="titleLi">学习生活</li>
            <li onclick="location.href='${basePath}/s/uc/shgh/jyzn'" class="titleLi">就业指南</li>
            <li onclick="location.href='${basePath}/s/uc/shgh/tsst'" class="titleLi">图书社团</li>
            <li onclick="location.href='${basePath}/s/uc/mh/f?no=4&q=http://xgjw.shghxyedu.net:8790/feed/feed.do?PageOnly=true&'"
                class="titleLi">交流分享
            </li>
            <li onclick="window.open('http://jpkc.shghxyedu.net:8106/')" class="titleLi">教学资源</li>
	    <li onclick="window.open('http://192.168.175.250/ssologin/home.aspx')" class="titleLi">一卡通</li>
        </ul>
        <%}%>
    </div>
</div>
